package shiro;

import lombok.extern.log4j.Log4j2;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.UsernamePasswordToken;
import org.apache.shiro.config.IniSecurityManagerFactory;
import org.apache.shiro.crypto.RandomNumberGenerator;
import org.apache.shiro.crypto.SecureRandomNumberGenerator;
import org.apache.shiro.crypto.hash.Md5Hash;
import org.apache.shiro.crypto.hash.SimpleHash;
import org.apache.shiro.mgt.SecurityManager;
import org.apache.shiro.subject.Subject;
import org.apache.shiro.util.Factory;
import org.junit.Assert;

@Log4j2
public class Main {
	public static void main(String[] args) {
	/*	Factory<SecurityManager> factory =  new IniSecurityManagerFactory("classpath:shiro.ini");
		SecurityManager manager = factory.getInstance();
		SecurityUtils.setSecurityManager(manager);
		Subject subject = SecurityUtils.getSubject();
		UsernamePasswordToken token = new UsernamePasswordToken("zhang", "123");
		try {
			subject.login(token);
		} catch (Exception e) {
			log.error(e);
		}
		Assert.assertEquals(true, subject.isAuthenticated()); //断言用户已经登录
	    //6、退出
		
	    subject.logout();*/
		/*String secret = new Md5Hash("123", "123").toBase64();
		System.out.println(secret);*/
		
		 RandomNumberGenerator randomNumberGenerator = new SecureRandomNumberGenerator();
		/* String newPassword = new SimpleHash("md5", user.getPassword(),12, salt).toHex()*/
		
		
		
	}
}
